package com.kung.qvs.ui.main;

import android.os.Bundle;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import com.kung.qvs.entity.ProductBean;
import com.kung.qvs.entity.ProductTypeBean;
import com.kung.qvs.entity.WorkerBean;

import java.util.List;

public class KungViewModel extends ViewModel {
    private MutableLiveData<Boolean> mIsHomeFrag = new MutableLiveData<>(true);    //是否在首页frag
    private MutableLiveData<Boolean> mIsBleBalanceConnect = new MutableLiveData<>(false);   //蓝牙秤连接状态
    private MutableLiveData<Boolean> mIsBlePrinterConnect = new MutableLiveData<>(false);   //打印机连接状态
    private MutableLiveData<String> mWeight = new MutableLiveData();  //重量
    private MutableLiveData<Boolean> mIsHasHardWareCode= new MutableLiveData<>(false);

    private MutableLiveData<Boolean> mIsFinishUpload = new MutableLiveData<>(false);    //上传成功通知

    private MutableLiveData<List<ProductTypeBean>> mProductTypes = new MutableLiveData<>();    //产品类型列表

    private MutableLiveData<WorkerBean> mSelectWorker = new MutableLiveData<>();    //选择的工人
    private MutableLiveData<ProductBean> mSelectProduct = new MutableLiveData<>();    //选择的产品

    private MutableLiveData<String> mSearchWorkerCode = new MutableLiveData<>();    //需要查询上传记录的工人
    private MutableLiveData<String> mScanProductCode = new MutableLiveData<>();    //扫描的产品码

    //选择的打印次数
    private MutableLiveData<Integer> mSelectPrintCount = new MutableLiveData<>(1);

    public void sendWeight(String weight){
        mWeight.postValue(weight);
    }

    public MutableLiveData<String> getMWeight(){
        return mWeight;
    }

    public MutableLiveData<Boolean> getmIsHomeFrag() {
        return mIsHomeFrag;
    }

    public void setmIsHomeFrag(Boolean mIsHomeFrag) {
        this.mIsHomeFrag.postValue(mIsHomeFrag);
    }

    public MutableLiveData<Boolean> getmIsBleBalanceConnect() {
        return mIsBleBalanceConnect;
    }

    public void setmIsBleBalanceConnect(MutableLiveData<Boolean> mIsBleBalanceConnect) {
        this.mIsBleBalanceConnect = mIsBleBalanceConnect;
    }

    public MutableLiveData<Boolean> getmIsBlePrinterConnect() {
        return mIsBlePrinterConnect;
    }

    public void setmIsBlePrinterConnect(MutableLiveData<Boolean> mIsBlePrinterConnect) {
        this.mIsBlePrinterConnect = mIsBlePrinterConnect;
    }

    public MutableLiveData<Boolean> getmIsHasHardWareCode() {
        return mIsHasHardWareCode;
    }

    public void setmIsHasHardWareCode(Boolean mIsHasHardWareCode) {
        this.mIsHasHardWareCode.postValue(mIsHasHardWareCode);
    }

    public MutableLiveData<Boolean> getmIsFinishUpload() {
        return mIsFinishUpload;
    }

    public void setmIsFinishUpload(Boolean mIsFinishUpload) {
        this.mIsFinishUpload.postValue(mIsFinishUpload);
    }

    public MutableLiveData<List<ProductTypeBean>> getmProductTypes() {
        return mProductTypes;
    }

    public void setmProductTypes(List<ProductTypeBean> mProductTypes) {
        this.mProductTypes.postValue(mProductTypes);
    }

    public MutableLiveData<WorkerBean> getmSelectWorker() {
        return mSelectWorker;
    }

    public void setmSelectWorker(WorkerBean mSelectWorker) {
        this.mSelectWorker.postValue(mSelectWorker);
    }

    public MutableLiveData<ProductBean> getmSelectProduct() {
        return mSelectProduct;
    }

    public void setmSelectProduct(ProductBean mSelectProduct) {
        this.mSelectProduct.postValue(mSelectProduct);
    }

    public MutableLiveData<String> getmSearchWorkerCode() {
        return mSearchWorkerCode;
    }

    public void setmSearchWorkerCode(String mSearchWorkerCode) {
        this.mSearchWorkerCode.postValue(mSearchWorkerCode);
    }

    public MutableLiveData<String> getmScanProductCode() {
        return mScanProductCode;
    }

    public void setmScanProductCode(String mScanProductCode) {
        this.mScanProductCode.postValue(mScanProductCode);
    }

    public MutableLiveData<Integer> getmSelectPrintCount() {
        return mSelectPrintCount;
    }

    public void setmSelectPrintCount(Integer mSelectPrintCount) {
        this.mSelectPrintCount.postValue(mSelectPrintCount);
    }
}
